<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        ul{
            list-style: none;
        }
        .active{
            color:#fff;
            background: red;
        }
        ul li a{
            display: block;
            height: 30px;
            line-height: 30px;
            width: 80px;
            text-align: center;
            background: #fff;
            color:#333;
            font-size: 14px;
            text-decoration: none;
        }
    </style>
</head>
<body>
    <div id="app">
        <ul>
            <li><a href="#" :class={active:isActive} @click="isActive = !isActive">首页</a></li>
        </ul>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    <script>
        new Vue({
            el:"#app",
            data:{
               isActive:false
            },
            methods:{
               
            },
            computed:{
               
            }
            
        })
    </script>
</body>
</html>